﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using SqlSugar;

namespace Aioms.Models
{
    ///<summary>
    /// 巡检点
    ///</summary>
    [SugarTable("inspection_point")]
    public class InspectionPoint
    {
        public InspectionPoint() {
            this.Created = DateTime.Now;
            this.Updated = DateTime.Now;
        }
        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:False
        /// </summary>           
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
        [JsonProperty("id")]
        public long Id { get; set; }

        /// <summary>
        /// Desc:企业id
        /// Default:
        /// Nullable:True
        /// </summary>        
        [SugarColumn(ColumnName = "eid")]
        [JsonProperty("eid")]
        public int Eid { get; set; }

        /// <summary>
        /// Desc:巡检路线id
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "ilid")]
        [JsonProperty("ilid")]
        public int Ilid { get; set; }

        /// <summary>
        /// 多个设备ID如：[1, 2, 3]
        /// </summary>           
        [SugarColumn(ColumnName = "dvids")]
        [JsonProperty("dvids")]
        public string Dvids { get; set; }

        /// <summary>
        /// Desc:巡检点名称
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "name")]
        [JsonProperty("name")]
        public string Name { get; set; }

        /// <summary>
        /// Desc:位置信息
        /// Default:
        /// Nullable:True
        /// </summary>  
        [SugarColumn(ColumnName = "position")]
        [JsonProperty("position")]
        public string Position { get; set; }

        /// <summary>
        /// Desc:巡检范围
        /// Default:
        /// Nullable:True
        /// </summary>   
        [SugarColumn(ColumnName = "range")]
        [JsonProperty("range")]
        public int Range { get; set; }

        /// <summary>
        /// Desc:排序字段
        /// Default:
        /// Nullable:True
        /// </summary>       
        [SugarColumn(ColumnName = "sort_id")]
        [JsonProperty("sort_id")]
        public int SortId { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>       
        [SugarColumn(ColumnName = "created")]
        [JsonProperty("created")]
        public DateTime? Created { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>  
        [SugarColumn(ColumnName = "updated")]
        [JsonProperty("updated")]
        public DateTime? Updated { get; set; }

        /// <summary>
        /// 软删除标记：1.删除 0.未删除
        /// </summary>           
        [SugarColumn(ColumnName = "isdel")]
        public int IsDel { get; set; } = 0;

        /// <summary>
        /// 设备对象
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [JsonProperty("devices")]
        public List<Device> Devices { get; set; }

    }
}
